# 内置请求模块
from urllib import request
import json

url = "http://httpbin.org/get?name=qiku&address=dongsanjie"
# 使用request模块发起请求
res = request.urlopen(url, )
# print(res, dir(res))
# 获取响应内容
content_bytes = res.read()
# 字节流转字符串
content = content_bytes.decode()
print(content)
# 字符串转字典(反序列化)
data = json.loads(content)
print(data)
print(data['headers']['User-Agent'])

# http://httpbin.org
# get请求：


# 自己安装的模块
# import requests
